package com.keyinong.restaurant;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;

public class PayPromptActivity extends Activity implements OnClickListener{
	private ImageView img_back;
	private TextView tv_title;
	private ImageView img_payStatus;
	private ImageView btn_saoyisao;
	
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_payprompt_layout);
		initView();
	}

	private void initView() {
		img_back=(ImageView) findViewById(R.id.img_back);
		img_payStatus=(ImageView) findViewById(R.id.img_payStatus);
		tv_title=(TextView) findViewById(R.id.tv_title);
		btn_saoyisao=(ImageView) findViewById(R.id.btn_saoyisao);
		img_back.setVisibility(View.VISIBLE);
		btn_saoyisao.setVisibility(View.GONE);
		img_back.setOnClickListener(this);
		tv_title.setText("支付状态");
		
		boolean code=getIntent().getBooleanExtra("code", false);
		String msg=getIntent().getStringExtra("msg");
		
		if(!code){
			img_payStatus.setImageResource(R.drawable.img_pay_failure);
			Toast.makeText(PayPromptActivity.this,msg, 
					Toast.LENGTH_SHORT).show();
		}
		
	}

	@Override
	public void onClick(View v) {
		switch (v.getId()) {
		case R.id.img_back:
			finish();
			break;
		}
		
	}
	

}
